<template>

  <div class="backView">
    <div class="closeIcon" @click="closeClick">
      <img style="width: 16px; height: 16px;" src="../../../../../static/img/m/windows_close.png" />
    </div>
    <span class="priceLabel"><span style="font-size: 18px">¥</span> {{price}}</span>
    <p class="tipLabel">选择支付方式</p>
    <p @click="wxClick" class="typeLabel">微信</p>
<!--    <p @click="zfbClick" v-show="!isWxCore" class="typeLabel">支付宝</p>-->
  </div>
</template>

<script>
  import {client,} from 'as-common'
  import {Toast} from 'vant'

  export default {
    props:['price'],
    computed:{
      isWxCore(){
        let version = client.ver(navigator.userAgent)
        return version.WEIXIN
      }
    },
    methods:{
      closeClick() {
        this.$emit('sendCloseCover');
      },
      wxClick() {
        this.$emit('sendPayWithType', 1)
      },
      zfbClick() {
        if (this.isWxCore) {
          Toast('微信内不支持支付宝支付')
          return
        }
        this.$emit('sendPayWithType', 3)
      },
    }
  }

</script>

<style scoped>
  .backView {
    background-color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .closeIcon {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 8px;
  }
  .priceLabel {
    margin-top: 72px;
    font-size: 28px;
    color: #FF3328;
  }
  .tipLabel {
    margin-top: 40px;
    font-size: 14px;
    color: #999999;
    margin-bottom: 18px;
  }
  .typeLabel {
    width: 100%;
    line-height: 56px;
    font-size: 14px;
    color: #333333;
    border-top: #E7E7E7 solid 1px;
    text-align: center;
  }

</style>
